package wodegua.d2_demo;

public class PrimeNumber2 {
    public static void main(String[] args) {
        System.out.println(prime(101, 200));
    }

    public static int prime(int start, int end){
        int count = 0;
        for (int i = start; i <= end; i++) {
            if (is(i)) {
                count++;
                System.out.println(i);
            }
        }
        return count;
    }

    public static boolean is(int i){
        for (int j = 2; j < i/2; j++) {
            if (i%j == 0) {
                return false;
            }
        }
        return true;
    }
}
